package com.fcfactory.eggutils.dbUtils.controller;

import com.fcfactory.eggutils.common.RestResponse;
import com.fcfactory.eggutils.dbUtils.service.DBUtilService;
import com.fcfactory.eggutils.dbUtils.dto.GenerationCodeParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @autuor 范大晨
 * @Date 2023/9/19 18:51
 * @description 数据库工具接口
 */
@RestController
@RequestMapping("/dbUtil")
public class DBUtilController {
    @Autowired
    private DBUtilService dbUtilService;

    /**
     * 代码生成器 生成实体类，mapper，service，controller
     * @param generationCodeParam 代码生成时的配置
     * @return 统一结果返回类
     */
    @PostMapping("/generationCode")
    public RestResponse generationCode(@RequestBody GenerationCodeParam generationCodeParam){
        return dbUtilService.generationCode(generationCodeParam);
    }
}
